<?php

namespace app\common\model;

use app\common\exception\BusinessException;
use think\Model;

class App extends Model
{
    /**
     * getAppById
     * @param $appId
     * @return mixed
     * @throws BusinessException
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function getAppById($appId)
    {
        $where = [
            'app_id' => $appId
        ];
        $appInfo = $this->where($where)->find();
        if (!$appInfo) {
            throw new BusinessException('租户信息不存在');
        }
        return $appInfo;
    }
}